package com.shujia.java.day18.demo2;
/**
* @Description: Demo2  自己设置线程名字
* @Author: 王火火
* @Date: 2019/8/20 10:47
*/
public class Demo2 {
    public static void main(String[] args) {
        //创建多个对象来实现多线程
        MyThreadDemo2 thread = new MyThreadDemo2();
        MyThreadDemo2 thread1 = new MyThreadDemo2();
        //给线程名字赋值
        thread.setName("张三");
        thread1.setName("李四");
        //启动通过调用start()
        thread.start();
        thread1.start();

    }
}
